/**
 * 功能描述:
 * 相关配置文件:
 * @author Administrator
 */
package cn.framework.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public interface BaseHibernateDao<T> {

	@Transactional(propagation = Propagation.REQUIRED)
	public abstract  boolean delete(Object domain);

	@Transactional(propagation = Propagation.REQUIRED)
	public abstract boolean deleteByKey(Serializable id) ;

	@Transactional(propagation = Propagation.REQUIRED)
	public abstract  boolean delete(List domainList);

	@Transactional(propagation = Propagation.REQUIRED)
	public abstract T save(Object domain);

	@Transactional(propagation = Propagation.REQUIRED)
	public abstract T saveOrUpdate(Object domain);

	@Transactional(propagation = Propagation.REQUIRED)
	public abstract T update(Object domain);

	public abstract List<T> findByExample(Object value);

	public abstract List<T> findByExample(Object value,int firstResult,int maxResults);
	
	public abstract List<T> findAll();

	public abstract List<T> findAll(int firstResult, int size);

	public abstract T findById(Serializable id);


	public abstract List<T> findByProperty(String propertyName, Object value);

	public abstract List<T> findByProperty(String propertyName, Object value,
			Integer firstResult, Integer size);

	public abstract List<T> findByProperty(String[] propertyNames,
			Object[] values);
	
	public abstract T findByUnique(String propertyName, Object value);
	
	public abstract T findByUnique(String[] propertyNames,
			Object[] values);

	public abstract List<T> findByProperty(String[] propertyNames,
			Object[] values, Integer firstResult, Integer size);

	public abstract List<T> findIn(String propertyName, Object[] value);
	
	public abstract int getCount();

	public abstract int getCount(String propertyName, Object value);

	public abstract int getCount(String[] propertyNames, Object[] values);

	public abstract List<T> fuzzyFindByProperty(String propertyName,
			Object value);

	public abstract List<T> fuzzyFindByProperty(String propertyName,
			Object value, Integer firstResult, Integer size);

	public abstract List<T> fuzzyFindByProperty(String[] propertyNames,
			Object[] values);

	public abstract List<T> fuzzyFindByProperty(String[] propertyNames,
			Object[] values, Integer firstResult, Integer size);
	
	
	public abstract List<T> findOrByProperty(String[] propertyNames, Object[] values,
			Integer firstResult, Integer size);

	public abstract List<T> findOrLikeByProperty(String[] propertyNames, Object[] values);
	
	public abstract List<T> findOrLikeByProperty(String[] propertyNames, Object[] values,
			Integer firstResult, Integer size);
	
	public abstract String getDbTableName();

	public abstract List<String> getDbCelName();
	
	public void setDesc(boolean desc);
	

}